<%@page import="model.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
String uid="";
	User u = new User();
	National national = new National();
	int sp = national.getSizeDB();
	int pt = 0;
	int a = 0;
	/* giá trị trả lại tri servlet khi có lỗi xảy ra */
	String tmp = ((String)request.getAttribute("pt"));
	if(tmp!=null){ pt= Integer.parseInt(tmp);};
	String en = (String) request.getAttribute("en");
	en = (en==null)? "*":en ;
	//check User is not admin  redirect to index
	if (!u.isAdmin((String) session.getAttribute("lv"))) {
		response.sendRedirect("../index.jsp");
	}else{
		 uid = (String) session.getAttribute("uid");
	}
%>
<title>MYFILM - National</title>
		<form action="AddNational" onsubmit="return validate(this)" method="post">
			<fieldset>
				<legend>Add National</legend>
				<div>
					<label for="nn">National: <span class="required"><%=en %></span></label>
					<input type="text" name="nn" id="von" value="" size="20" maxlength="150" tabindex="1"/>
				</div>
				<div>
					<label for="pt">Position: <span class="required">*</span></label> 
					<select name="pt" tabindex='2'>
						<%for(int i =1; i<=(sp+1);i++){ %>
						<option value="<%=i%>" <%=(i==pt)?"selected='selected'":""%>><%=i%></option>
						<%} %>
					</select>
				</div>
				<input type="hidden" name="uid" value="<%=uid%>">
				
			</fieldset>
			<p>
				<input type="submit" name="submit" value="Add National" />
			</p>
		</form>